-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a new input syntax for function. #1254
base: dev
Are you sure you want to change the base?
Conversation
@DavidFangWJ We shouldn't actually need to modify We will need to change how patterns in let bindings are processed in the statics and elaboration to special case the situation where the top-level pattern is |
Regarding the type error, take a look at the definition of Regarding the function itself, you should be looking for the application of a variable, rather than a constructor. Constructors are capitalized. You also do not need to check that all arguments have type annotations -- it is okay to leave an argument unannotated, it will just get the unknown type. You also need to handle optional return type annotations (which will require changing the return type of your function overall). Please write some additional examples in your PR message to handle both functions with missing type annotations on arguments and missing return types, so make it clear these are all valid. We'll turn these into tests as well. |
…/hazel into haz3l-new-func-syntax
Cannot fully understand the part in
|
@DavidFangWJ there is a small merge conflict + the following has an error on |
Motivation
Add a more compact syntax to function, such that
should behave the same as below:
This new function syntax is more analogous to other programming languages with strong data types, and is therefore easier to learn.
Implementation Strategy
I believe that it will mostly be a modification of
Form.re
.